package com.zch.transformation;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

@SuppressWarnings({"all"})
public class OutputStreamWriter01 {
    public static void main(String[] args) throws IOException {
        // 1.创建流对象
        OutputStreamWriter osw =
                new OutputStreamWriter(new FileOutputStream("d:\\a.txt"), "gbk");
        // 2.写入
        osw.write("hello,韩顺平教育~");
        // 3.关闭，才算真正写入
        osw.close();
        System.out.println("保存成功~");
    }
}
